<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8" />
		<title>1.localStorage</title>
	</head>
	<body>
		<button onclick="save()">点我存数据</button>
		<button onclick="read()">点我读数据</button>
		<button onclick="remove()">点我删除某个数据</button>
		<button onclick="clearAll()">点我清空数据</button>

		<script type="text/javascript" >
			function save(){
				localStorage.setItem('name',JSON.stringify({a:1}))
				localStorage.setItem('age',18)
			}
			function read(){
				let x = localStorage.getItem('name567')
				console.log(x)
				console.log(JSON.parse(null))
			}
			function remove(){
				localStorage.removeItem('name')
			}
			function clearAll(){
				console.log(1)
				localStorage.clear()
			}
		</script>
	</body>
</html>